package com.tushare.service.impl;

import com.tushare.entity.FinaIndicator;
import com.tushare.mapper.FinaIndicatorMapper;
import com.tushare.service.IFinaIndicatorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-03-07
 */
@Service
public class FinaIndicatorServiceImpl extends ServiceImpl<FinaIndicatorMapper, FinaIndicator> implements IFinaIndicatorService {

    @Override
    public boolean saveFinaIndicators(List<FinaIndicator> list) {
        if (list == null) {
            return false;
        }
        if (list.size() == 0) {
            return true;
        }
        return getBaseMapper().saveOrUpdateBatch(list);
    }

    @Override
    public List<FinaIndicator> getFinaIndicatorByTsCode(String ts_code) {
        return getBaseMapper().getFinaIndicatorByTsCode(ts_code);
    }

    @Override
    public boolean deleteAllDividend() {
        return getBaseMapper().deleteAllDividend();
    }
}
